﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GenericGA.reader.regex
{
    /// <summary>
    /// An abstract regular expression node which super classes regular expression nodes.
    /// </summary>
    /// <typeparam name="A">The type of the alphabet being matched.</typeparam>
    public abstract class Regex<A>
    {

        /// <summary>
        /// Generate a list which is matched by the regular expression based on a reader object.
        /// </summary>
        /// <param name="reader">Reader object to determine which list to generate.</param>
        /// <returns>A list which is matched by the regular expression.</returns>
        public abstract List<A> Generate(Reader reader);

        /// <summary>
        /// Enumerate every list which matches this regular expression.
        /// </summary>
        /// <returns>An iteration of the lists matched by the regular expression.</returns>
        public abstract IEnumerable<List<A>> Enumerate();

    }
}
